package runze.shiro.web;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.context.annotation.Scope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wrzhxy@qq.com
 * @date 2018年1月2日
 */
@RestController
@Scope("prototype")
@RequestMapping("/hello")
public class UserController {
	@RequiresPermissions("user:edit")
	@GetMapping("/a")
	public String a() {
		return "a";
	}
	@RequiresRoles("user")
	@GetMapping("/b")
	public String b() {
		return "B";
	}
	@RequiresPermissions("user:delete")
	@GetMapping("/c")
	public String c() {
		return "c";
	}
	
}
